package model;

import java.util.LinkedList;

public class TransPartLibrary {
	LinkedList<TransPart> partData = new LinkedList<TransPart>();
	
	public TransPart find(String dev, String pac, String lib) {
		for (TransPart i: partData) {
			System.out.println("Device: " + (dev.equals(i.device)) + ", Package: " + (pac.equals(i.pack)) + ", Library: " +  (lib.equals("e-kondensatoren")));
			if ((dev.equals( i.device)) && (pac.equals(i.pack)) && (lib.equals(i.library))) {
				return i;
			}
		}
		return null;
	}

	public TransPartLibrary() {
		super();
		this.partData = new LinkedList<TransPart>();
	}
	

	public static TransPartLibrary testLibrary(){
		TransPartLibrary lib = new TransPartLibrary();
		
		LinkedList<String> condConnKey = new LinkedList<String>();
		condConnKey.add("1");
		condConnKey.add("2");
		LinkedList<String> condConnVal = new LinkedList<String>();
		condConnVal.add("p");
		condConnVal.add("n");
		TransConn condConn = new TransConn(condConnKey, condConnVal);
		lib.partData.add(new TransPart("KONDENSATOR_KAPAZITAET_ALLGEMEIN", "KONDENSATOR_KAPAZITAET_ALLGEMEIN", "e-kondensatoren", "", condConn, "Modelica.Electrical.Analog.Basic.Resistor", 1, "R="));
		
		return lib;
	}
}